#ifndef POWERWINDOW_H
#define POWERWINDOW_H

#include <QObject>
#include <QWindow>

extern "C" {
#include <libavutil/pixfmt.h>
}
#include <qt_windows.h>
#include "screencapture.h"

class DcCapture : public ScreenCapture
{
    Q_OBJECT
public:
    explicit DcCapture(int widId, QObject *parent=nullptr);
    virtual ~DcCapture();
    virtual QByteArray getFramebuffer();
    virtual void getFramebuffer(QByteArray &data);
    virtual void getFramebuffer(char* data);
    virtual AVPixelFormat pixelFormat();

    int x();
    int y();
    int width();
    int height();
    int winId();

    void postMouseEvent(int button, bool isPress, int x,int y);
    void postKeyEvent(int key, bool isPress);
    void postWheelEvent(int delta);
    static int translateKeyCode(int key);

signals:

public slots:
private:
    HDC m_deskDC;
    HDC m_memDC;
    HBITMAP m_deskBM;
    int m_winId;

    Q_DISABLE_COPY(DcCapture)
};

#endif // POWERWINDOW_H
